Skip to content

Resolve the audio output sink through EasyEffects 8 - #13396

Merged
dhh merged 3 commits into
omacom:quattrofrom
stefanoverna:easyeffects-sink-resolver
Oct 4, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
stefanoverna:easyeffects-sink-resolver

Conversation

@stefanoverna

@stefanoverna stefanoverna commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

omarchy-audio-output-sink follows a DSP sink to the physical sink through the DSP's playback stream. EasyEffects 8 has no such stream: its output node links its ports straight to the sink's playback ports, so the search finds nothing and the volume keys, the bar's audio panel and the output switcher all act on easyeffects_sink itself. That sink's volume is inert (its monitor, which EasyEffects reads, does not follow it), so the OSD moves while the speakers do not.

Fix. Follow the port links (pw-link -l) to the alsa_output sink instead. When EasyEffects is idle it drops those links, so fall back to the output device named in its settings (~/.config/easyeffects/db/easyeffectsrc), if that sink exists. Filter-chain tunings keep resolving through their stream as before.

Reproduce. easyeffects --service-mode, make easyeffects_sink the default output, press the volume keys: the OSD changes, loudness does not. With the patch the keys and the panel move the card.

Test. test/shell.d/audio-output-sink-test.sh stubs pactl and pw-link and covers: physical default, EasyEffects playing (port links), EasyEffects idle (configured device), a configured device that is gone, and a filter-chain tuning. Only this focused test was run.

Tested on Omarchy 4.0.4 with EasyEffects 8.2.9 and PipeWire 1.6.8.

🤖 Generated with Claude Code

Fixes #9021

Fixes #12204

omarchy-audio-output-sink follows a DSP sink to the physical sink through the
DSP's playback stream. EasyEffects 8 has no such stream: its output node links
its ports straight to the sink's playback ports, so the search found nothing
and the volume keys, the bar's audio panel and the output switcher all acted on
easyeffects_sink itself. That sink's volume is inert -- its monitor, which
EasyEffects reads, does not follow it -- so the OSD moved while the speakers
did not.

Follow the port links to the alsa_output sink instead, and when EasyEffects is
idle and has dropped them, use the output device its settings name, if that
sink exists. Filter-chain tunings keep resolving through their stream as before.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@omarchybot omarchybot added the bug Something isn't working label Sep 27, 2026
@llstrk

llstrk commented Sep 29, 2026

Copy link
Copy Markdown

Automated AI review

Community review: Independent automated community review, unaffiliated with the Omarchy team, intended to help prepare PRs for their review.

Outcome: While EasyEffects plays into Bluetooth headphones, the live port link is ignored and the resolver falls back to easyeffectsrc, or to easyeffects_sink when there is none.

Only alsa_output.* links are followed

bin/omarchy-audio-output-sink:64 skips ee_soe_output_level:output_FL |-> bluez_output.…:playback_FL, so the resolver falls back to the settings file. Impact: with no easyeffectsrc (for example a Flatpak install) the keys still move the inert easyeffects_sink; with a file naming another present device, they change that device's volume instead of the headphones'. EasyEffects 8.2.9 saves that file only when its window hides or closes, every 30 s by default while it is shown, and on quit, so in service mode it can be out of date.

Suggested change: Match any sink playback port ($2 ~ /:playback_/), and add a Bluetooth scenario to the test.

Reproducer

Reproducer: live EasyEffects link to a Bluetooth sink is ignored

Synthetic, stub-based (no audio server). Append either block, unchanged, to the
end of test/shell.d/audio-output-sink-test.sh at the reviewed head
(91fd24c) and run
bash test/shell.d/audio-output-sink-test.sh. The blocks reuse the file's own
reset_scenario, resolve and $physical.

Block A: Bluetooth link, settings file still names the speakers

# EasyEffects playing into Bluetooth headphones: the live port links name the
# headphones, while the settings file still names the speakers (EasyEffects
# writes easyeffectsrc only when its window closes, on a 30 s autosave while the
# window is open, and on quit). The live link should win.
headphones=bluez_output.00_11_22_33_44_55.1
reset_scenario
printf '267\t%s\tPipeWire\ts32le 4ch 44100Hz\tSUSPENDED\n301\t%s\tPipeWire\ts16le 2ch 48000Hz\tRUNNING\n870\teasyeffects_sink\tPipeWire\tfloat32le 2ch 48000Hz\tRUNNING\n' \
  "$physical" "$headphones" >"$test_home/data/sinks"
cat >"$test_home/data/links" <<LINKS
ee_soe_output_level:output_FL
  |-> $headphones:playback_FL
ee_soe_output_level:output_FR
  |-> $headphones:playback_FR
LINKS
mkdir -p "$test_home/.config/easyeffects/db"
printf '[StreamOutputs]\noutputDevice=%s\n' "$physical" >"$test_home/.config/easyeffects/db/easyeffectsrc"
resolved=$(resolve)
printf '# bluetooth link + settings naming the speakers -> %s\n' "$resolved"
[[ $resolved == "$headphones" ]] ||
  fail "easyeffects_sink playing into Bluetooth resolves to the headphones" "expected: $headphones"$'\n'"actual:   $resolved"
pass "easyeffects_sink playing into Bluetooth resolves to the headphones"

Actual output at the reviewed head, exit status 1.

stdout:

ok - physical default sink resolves to itself
ok - easyeffects_sink resolves through its port links
ok - idle easyeffects_sink resolves through the configured output device
ok - missing configured device falls back to the DSP sink
ok - filter-chain tuning resolves through its stream
# bluetooth link + settings naming the speakers -> alsa_output.pci-0000_00_1f.3.analog-surround-40

stderr:

expected: bluez_output.00_11_22_33_44_55.1
actual:   alsa_output.pci-0000_00_1f.3.analog-surround-40
not ok - easyeffects_sink playing into Bluetooth resolves to the headphones

Block B: Bluetooth link, no settings file

# EasyEffects playing into Bluetooth headphones with no settings file (for
# example a Flatpak install, whose settings live under ~/.var/app).
headphones=bluez_output.00_11_22_33_44_55.1
reset_scenario
printf '267\t%s\tPipeWire\ts32le 4ch 44100Hz\tSUSPENDED\n301\t%s\tPipeWire\ts16le 2ch 48000Hz\tRUNNING\n870\teasyeffects_sink\tPipeWire\tfloat32le 2ch 48000Hz\tRUNNING\n' \
  "$physical" "$headphones" >"$test_home/data/sinks"
cat >"$test_home/data/links" <<LINKS
ee_soe_output_level:output_FL
  |-> $headphones:playback_FL
ee_soe_output_level:output_FR
  |-> $headphones:playback_FR
LINKS
resolved=$(resolve)
printf '# bluetooth link, no settings file -> %s\n' "$resolved"
[[ $resolved == "$headphones" ]] ||
  fail "easyeffects_sink playing into Bluetooth resolves to the headphones without a settings file" "expected: $headphones"$'\n'"actual:   $resolved"
pass "easyeffects_sink playing into Bluetooth resolves to the headphones without a settings file"

Actual output at the reviewed head, exit status 1.

stdout:

ok - physical default sink resolves to itself
ok - easyeffects_sink resolves through its port links
ok - idle easyeffects_sink resolves through the configured output device
ok - missing configured device falls back to the DSP sink
ok - filter-chain tuning resolves through its stream
# bluetooth link, no settings file -> easyeffects_sink

stderr:

expected: bluez_output.00_11_22_33_44_55.1
actual:   easyeffects_sink
not ok - easyeffects_sink playing into Bluetooth resolves to the headphones without a settings file

With the suggested change

In a disposable copy of the resolver, replacing $2 ~ /^alsa_output\..*:playback_/
with $2 ~ /:playback_/ made the five existing scenarios, both blocks above and a
"live ALSA link beats a settings file naming another present card" scenario pass
(exit 0).

Optional notes
Reproducer: test header

Reproducer: the new test keeps going after mktemp -d fails

The new test/shell.d/audio-output-sink-test.sh has no set -euo pipefail
(the header docs/testing.md prescribes for every shell test). When mktemp -d
fails, test_home and test_bin are empty and reset_scenario goes on to run
rm -rf "/data" "/.config" and mkdir -p "/data".

Safe to run: rm, mkdir, pactl and pw-link are replaced by stubs that
only print what would have run. Run from the repository root at the reviewed
head (91fd24c):

#!/bin/bash
# Run from the repository root at the reviewed head. rm and mkdir (and the audio
# clients) are replaced by stubs that only print what would have run, so nothing
# is removed and no audio server is queried.
guard=$(mktemp -d)
trap 'rm -rf "$guard"' EXIT
for tool in rm mkdir pactl pw-link; do
  cat >"$guard/$tool" <<'STUB'
#!/bin/bash
printf 'would run: %s %s\n' "$(basename "$0")" "$*" >&2
exit 1
STUB
  chmod +x "$guard/$tool"
done
TMPDIR=/nonexistent PATH="$guard:$PATH" bash test/shell.d/audio-output-sink-test.sh
echo "exit=$?"

Actual output (run in a sandbox whose root filesystem is read-only, hence
"Read-only file system" where a normal host would say "Permission denied").

stdout:

exit=1

stderr:

mktemp: failed to create directory via template ‘/nonexistent/tmp.XXXXXXXXXX’: No such file or directory
mktemp: failed to create directory via template ‘/nonexistent/tmp.XXXXXXXXXX’: No such file or directory
test/shell.d/audio-output-sink-test.sh: line 15: /pactl: Read-only file system
test/shell.d/audio-output-sink-test.sh: line 24: /pw-link: Read-only file system
chmod: cannot access '/pactl': No such file or directory
chmod: cannot access '/pw-link': No such file or directory
would run: rm -rf /data /.config
would run: mkdir -p /data
test/shell.d/audio-output-sink-test.sh: line 40: /data/default-sink: No such file or directory
test/shell.d/audio-output-sink-test.sh: line 41: /data/sinks: No such file or directory
test/shell.d/audio-output-sink-test.sh: line 47: /data/default-sink: No such file or directory
not ok - a physical default sink resolves to itself
would run: rm -rf  

With the documented header (set -euo pipefail and the BASH_SOURCE source
line) the same file stops at the first mktemp -d failure: its only output is the
first mktemp: failed to create directory ... line and no rm or mkdir call is
made. With that header and a working mktemp, all five of the PR's scenarios still
pass.


Review information

Test scope: Source review and stubbed sandbox tests at 91fd24c2; no live EasyEffects, PipeWire or Bluetooth device.

AI process: Opus 5.5 Medium coordination and synthesis, Opus 5.5 Xhigh technical review and final fact check, GPT 6 Sol Xhigh search for related issues, Opus 5.5 Medium editorial check.

Opt out: To stop receiving these reviews, reply to this comment saying so.

omarchybot and others added 2 commits October 3, 2026 07:06
EasyEffects plays into Bluetooth headphones through the same direct port links as into a card, but only alsa_output targets were followed, so with headphones on the keys fell back to the settings file -- which can still name the speakers -- or to easyeffects_sink. Match bluez_output sinks as well, and compare the configured device name literally rather than as a regex.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/testing.md asks every shell test to start with set -euo pipefail and source base-test.sh through BASH_SOURCE; without it a failed mktemp leaves test_home empty and reset_scenario goes on to rm -rf /data.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerConfidence Score: 5/5

[Medium risk] Adds audio sink resolution logic for EasyEffects 8.

The PR appears safe to merge based on the issues established in this review.

Summary

The PR adds port-link resolution for an active EasyEffects 8 output and a configured-device fallback when it is idle, while retaining stream-based resolution for filter-chain tunings.

  • Adds focused shell tests for physical, active, idle, missing-device, Bluetooth, and filter-chain cases.
Diagram
%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Requested or default sink] --> B{Stream-based downstream sink found?}
  B -- Yes --> C[Return downstream sink]
  B -- No --> D{EasyEffects sink?}
  D -- No --> E[Return requested sink]
  D -- Yes --> F{Physical sink in port links?}
  F -- Yes --> G[Return linked sink]
  F -- No --> H{Configured sink exists?}
  H -- Yes --> I[Return configured sink]
  H -- No --> E
Loading

Reviews (1) · Last reviewed commit: "Give the audio output sink test the stan..."

@omarchybot omarchybot added verified Omarchy Triage has verified that this issue is ready for final review ready Good to merge labels Oct 3, 2026
@omarchybot

Copy link
Copy Markdown
Collaborator

Thank you, @stefanoverna. Reviewed at 63c31bc6, and reproduced on a worker built from the Omarchy ISO, with EasyEffects 8.2.9 in service mode on PipeWire 1.6.8 and two null sinks named like an ALSA card and a Bluetooth device. On quattro, omarchy-audio-output-sink returns easyeffects_sink while EasyEffects plays into the card, and omarchy-audio-output-volume -5 lowers easyeffects_sink while the card stays at 50%. With this branch it returns the card and the same key takes the card to 45%. Taking the fix back out brings the bug back.

I pushed two commits to your branch:

  • 357d84f — Bluetooth. bin/omarchy-audio-output-sink:65 followed only links to alsa_output.*. With EasyEffects playing into bluez_output.* headphones, the live link was skipped and the script fell back to easyeffectsrc. That file can still name the speakers (on the worker it named the previous device after a switch), and when it does, the keys move the speakers. With no file at all, they moved easyeffects_sink. Both cases happened on the worker. The match now accepts bluez_output.* as well, and there is a test for a live Bluetooth link winning over a file that names the speakers. That test fails without the change. The configured device name is also compared literally now (grep -qxF) rather than as a regex. @llstrk's review pointed out both.
  • 63c31bc — test header. test/shell.d/audio-output-sink-test.sh now starts with set -euo pipefail and the BASH_SOURCE source line that docs/testing.md asks for. Without them, a failed mktemp leaves test_home empty and reset_scenario runs rm -rf /data.

Tests on the worker: audio-output-sink-test.sh passes all six scenarios. ./test/all has 5 failures (ASCII art width, the logo animation, a pre_remove hook, linux-omarchy headers, the VS Code theme). All five also fail on quattro and have nothing to do with audio.

One limitation remains, and all three open fixes share it. When EasyEffects is idle it drops its links after a while, and the fallback then trusts easyeffectsrc. EasyEffects only writes that file on a timer or when it quits. Right after you switch outputs, an idle key press can therefore reach the previous device. That still beats moving easyeffects_sink, and as soon as audio plays, the live links take over.

#8713 and #9132 fix the same bug in the same lines. I compared the three diffs, and so did Codex Medium, separately and without being told my answer. Both of us picked this one. #8713 reads only the settings file, so it is wrong whenever the file is out of date. #9132 walks the link graph for any sink the switcher asks about, not only easyeffects_sink, so a loopback from another sink's monitor can become the answer. Codex Medium also reviewed this branch with my commits and found nothing to change. It agreed on the choice, but its independence is not guaranteed, because earlier comments on #8713 and #9132 had already reached the same conclusion. This pull request now closes #9021 and #12204.

Waiting on the maintainer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ready Good to merge verified Omarchy Triage has verified that this issue is ready for final review

Projects

None yet

5 participants